package com.androidmvp.dreammvp.simple3;
import com.androidmvp.dreammvp.simple3.base.BasePresenter;
import com.androidmvp.local.table.WeatherInfo;

import java.util.List;

import javax.inject.Inject;

/**
 * Presenter 主要起连接 View 和 Dao 的作用
 */
public class MainPresenter_3 extends BasePresenter {

    private MainView_3 mainView;
    public WeatherDao_3 weatherDao =new WeatherDao_3(this);

    @Inject
    public MainPresenter_3(MainView_3 mainView) {
        this.mainView=mainView;

    }
    public void getData(){
        mainView.showProgressBar();
        weatherDao.getData();
    }

    public void loadDataSuccess(List<WeatherInfo> list) {
        mainView.showData(list.get(0));
    }
    public void loadDataFailure(){
        mainView.showData(null);
    }
}
